package com.beiding.workordersystem.system.controller;

import com.beiding.workordersystem.common.standard.R;
import com.beiding.workordersystem.system.service.AuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/authority")
public class AuthorityController {

    @Autowired
    private AuthorityService authorityService;

    @GetMapping("/list")
    @PreAuthorize("hasAnyAuthority('role_get','role_save','role_authority_associate')")
    R list(){
        return R.ok(authorityService.list());
    }

}
